package com.huidatech.mpgdemo.controller;


import com.huidatech.mpgdemo.entity.Price;
import com.huidatech.mpgdemo.mapper.PriceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 产品市场价格表 前端控制器
 * </p>
 *
 * @author Wangzz
 * @since 2021-10-20
 */
@RestController
@RequestMapping("/mpgdemo/price")
public class PriceController {

    @Autowired
    private PriceMapper priceMapper;

    @GetMapping("/index")
    public String testInfo(){
        List<Price> priceList = priceMapper.selectList(null);
        return "we are the world";
    }

    @GetMapping("/records")
    public List<Price> getAllPrice(){
        return priceMapper.selectLatestRecords();
    }
}

